<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function camelize(str = "") {
        let r = "";
        const arr1 = str.split("-");
        const arr2 = arr1.map((v, i) => {
          return i >= 1 ? v[0].toUpperCase() + v.slice(1) : v;
        });
        console.log(arr2.join(""));
      }
      camelize("background-color"); //"backgroundColor";
      camelize("list-style-image"); //"listStyleImage";
      camelize("-webkit-transition"); //"WebkitTransition";
    </script>
  </body>
</html>
